home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / tests / fstrash / fstrash.man < prev    next >
Encoding:
Text File  |  1990-07-10  |  9.2 KB  |  239 lines

  1. ' Copyright 1989 Regents of the University of California
  2. ' Permission to use, copy, modify, and distribute this
  3. ' documentation for any purpose and without fee is hereby
  4. ' granted, provided that this notice appears in all copies.
  5. ' The University of California makes no representations about
  6. ' the suitability of this material for any purpose.  It is
  7. ' provided "as is" without express or implied warranty.
  8. ' $Header: /sprite/src/tests/fstrash/RCS/fstrash.man,v 1.1 90/07/09 21:45:39 jhh Exp Locker: jhh $ SPRITE (Berkeley)
  9. .so \*(]ltmac.sprite
  10. .HS fstrash cmds
  11. .BS
  12. .SH NAME
  13. fstrash \- Produces a completely trashed filesystem.
  14. .SH SYNOPSIS
  15. .nf
  16. \fBfstrash -dev \fIdevice\fP -part \fIpartition\fP [\fIoptions\fR]
  17. .SH OPTIONS
  18. .IP "\fB\-dev\fI device\fR" 14
  19. \fIDevice\fP is the root name of a device, i.e. rxy0, rsd1, rsb0
  20. .IP "\fB\-part\fI partition\fR" 14
  21. \fIPartition\fP is a letter indicating a partition, i.e. a, b, c, d, e, f, g.
  22. .IP "\fB\-dir\fI devDir\fR" 14
  23. \fIDevDir\fR is an alternate directory in which to find the device file
  24. named by concatenating \fIdevice\fR and \fIpartition\fR.  The default 
  25. directory name is ``/dev/``.
  26. .IP "\fB\-initialPart\fI firstPartName\fR" 14
  27. \fIfirstPartName\fP is the name of the initial partition on the disk
  28. which contains basic disk geometry information.  The default is partition
  29. ``a''.
  30. .IP "\fB\-write\fR" 14
  31. Write the disk.  The default is to
  32. not write the disk.
  33. .IP "\fB\-overlap\fR" 14
  34. Overlap filesystem blocks across track boundaries. The default is to not overlap
  35. blocks.
  36. .IP "\fB\-copySuper\fR" 14
  37. Copy the super block to the partition. The default is to not copy.
  38. .IP "\fB\-ratio\fR" 14
  39. Ratio of Kbytes to file descriptors. The default is 4.
  40. .IP "\fB\-test\fR" 14
  41. Don't write to the disk. This is the default.
  42. .IP "\fB\-freeRoot\fR" 14
  43. Set the flag field in the root file descriptor to indicate that it is free.
  44. The default is to mark the root file descriptor as allocated.
  45. .IP "\fB\-fileRoot\fR" 14
  46. Set the filetype field in the root file descriptor to indicate that it is a
  47. file. The default is to make the root a directory.
  48. .IP "\fB\-noRoot\fR" 14
  49. Zero out both the root file descriptor and data block 0. The default is
  50. to fill in the descriptor and to add files to the root.
  51. This option has precedence over both \fB\-freeRoot\fR and \fB\-fileRoot\fR.
  52. .BE
  53.  
  54. .SH DESCRIPTION
  55. .PP
  56. This program produces a trashed file system. It is intended to be used to
  57. test the \fBfscheck\fR program. The above section illustrates the use of the
  58. options. This section outlines the errors that are built into the filesystem
  59. and the actions \fBfscheck\fR should take to correct those errors.
  60. .SS FILE DESCRIPTORS
  61. .LP
  62. The following is a list of the file descriptors, their status in the
  63. file descriptor bitmap, and the file they represent.
  64. .KS
  65. .DS L
  66. .nf
  67. File #        Name                Status
  68. .sp
  69. 0        not used by filesystem        marked
  70. 1        bad blocks            marked
  71. 2        root                marked
  72. 3        "lost+found"            marked
  73. 4        "testFile"            marked
  74. 5        unreferenced file        unmarked
  75. 6        "tooBig"            marked
  76. 7        "tooSmall"            marked
  77. 8         "holeFile"            marked
  78. 9        "holeDir"            marked
  79. 10        "badIndexFile"            marked
  80. 11        "illegalFrag"            marked
  81. 12        "copyBadFrag"            marked
  82. 13        "copyBlock"            marked
  83. 14        "copyIndBlock"            marked
  84. 15        "copyBogusInd"            marked
  85. 16        unreferenced file        unmarked
  86. 17        unreferenced file        marked
  87. 18        "output"            marked
  88. 20        unused but marked        marked
  89. 21        "badDotDot"            marked
  90. 22        unallocated file (used by 21)    unmarked
  91. .fi
  92. .DE
  93. .KE
  94. .LP
  95. Fscheck should change the file descriptor bitmap to indicate that files 5 and
  96. 16 are allocated and that file 20 is unallocated. 
  97.  
  98. .SS DATA BLOCKS
  99. .LP
  100. The following is a list of the data blocks, their status in the data block
  101. bitmap and the number of the file that uses them. The block numbers are for
  102. 1k blocks so they actually represent fragments. 
  103.  
  104. .KS
  105. .DS L
  106. .nf
  107. Block #            File #            Status
  108. .sp
  109. 0            2            marked
  110. 1            not used        marked
  111. 4 - 9            3            marked
  112. 10            3            unmarked
  113. 11            3            marked
  114. 12 - 15            6            marked
  115. 16 - 17            7            marked
  116. 20 - 31            8            unmarked
  117. 32 - 39            9            marked
  118. 40 - 43            not used
  119. 44 - 47            10            marked
  120. 48 - 51            10,14            marked
  121. 52 - 55            10,14            marked
  122. 56 - 59            10,13,14,15        marked
  123. 60             12            unmarked
  124. 61            11,12            marked
  125. 62            11,12            marked
  126. 63            12            unmarked
  127. 64            17            marked
  128. 68 - 75            18            marked
  129. 76            21            marked
  130. .fi
  131. .DE
  132. .KE
  133. .LP
  134. The following blocks should be marked as in use by \fBfscheck\fR: 10, and 20-31.
  135. The following blocks should be marked as not in use: 1, 36-43, and 61.
  136. If the \fB\-delete\fR option of \fBfscheck\fR is not used, then \fBfscheck\fR 
  137. will 
  138. copy
  139. some of disk blocks. This will result in additional disk blocks being
  140. marked as in use. A total of 5 4k blocks are needed. There are two free 4k
  141. blocks in the range 36-43, so depending upon the \fBfscheck\fR implementation 
  142. these blocks may be reused. This would result in their status remaining
  143. unchanged, while 3 previously unused 4k blocks become used.
  144.  
  145. .SS FILES
  146. .LP 
  147. This section contains a description of the problems with each of the files
  148. created by \fBfstrash\fR and the actions \fBfscheck\fR should take to 
  149. correct them.
  150. .IP "File 1 - bad block file descriptor"
  151. File 1 is for bad blocks on the disk. Fscheck should not modify this descriptor
  152. unless the -badBlock option is given, in which case it should reset the
  153. contents of the descriptor.
  154. .IP "File 2 - \fIRoot\fR"
  155. If none of the "*Root" options are given the root directory should not be
  156. affected by \fBfscheck\fR. 
  157. If the \fB\-fileRoot\fR option is given to \fBfstrash\fR,
  158. then \fBfscheck\fR should reconstruct the root directory by adding file 3 
  159. (lost+found) to the root and updating the link count for file 3.
  160. If the \fB\-freeRoot\fR option is used, then \fBfscheck\fR should mark 
  161. file 2 as
  162. in use in addition to adding file 3 to the root.
  163. The \fB\-noRoot\fR option forces \fBfscheck\fR to do a lot of work 
  164. to fix the root.
  165. First, file 2 has to be marked in use. Secondly, any file that is using block
  166. 0 should either have this block deleted or a copy made. File 3 should be
  167. put in the root, and all other files should be put in file 3.
  168. .IP "File 3 - \fIlost+found\fR"
  169. The \fIlost+found\fR directory should be in the root and 
  170. should have its link count
  171. corrected when file 17 (an unreferenced directory) is added to it.
  172. .IP "File 4 - \fItestFile\fR"
  173. \fItestFile\fR is an empty file that is a child of the root. It should not be 
  174. modified by \fBfscheck\fR.
  175. .IP "File 5 - an unreferenced file"
  176. File 5 is an empty, unreferenced file that should be put into lost+found.
  177. .IP "File 6 - \fItooBig\fR"
  178. The size of the file \fItooBig\fR is greater than the amount of
  179. space in its data
  180. blocks. Its length should be truncated to the size of one direct block (4096
  181. bytes).
  182. .IP "File 7 - \fItooSmall\fR"
  183. The size of the file \fItooSmall\fR is smaller than the amount of space in its
  184. data blocks. Direct block 1 (17) should be deleted and its block count 
  185. corrected
  186. from 2 to 1.
  187. .IP "File 8 - \fIholeFile\fR"
  188. \fIholeFile\fR is a file with a hole in most of its direct blocks. 
  189. \fBfscheck\fR should not
  190. modify this file.
  191. .IP "File 9 - \fIholeDir\fR"
  192. Holes are not allowed in directories, so \fBfscheck\fR should 
  193. fill in the hole with empty entries. The hole is in the second direct block.
  194. .IP "File 10 - \fIbadIndexFile\fR"
  195. The \fIbadIndexFile\fR file has an invalid index in its first indirect block.
  196. This block (44) should be deleted so that the file has a hole, and the block
  197. count should be corrected from 1 to 4.
  198. The first direct block pointer is also invalid and should be made a hole.
  199. .IP "File 11 - \fIillegalFrag\fR"
  200. File 11 has a fragment that is not the last block in the file. This fragment
  201. (61)
  202. should be turned into a hole and the block count corrected from 2 to 1.
  203. .IP "File 12 - \fIcopyBadFrag\fR"
  204. The first direct block in file 12 shares one fragment with file 11. 
  205. It should be copied. The second direct block is a fragment that is also shared
  206. with file 11. Only one fragment's worth of data should be copied.
  207. .IP "File 13 - \fIcopyBlock\fR"
  208. This file contains 2 duplicate blocks. Block 0 is reserved for the root
  209. directory and should be either deleted or copied, even if the root directory
  210. doesn't exist. Block 56 is shared with file 10 and should be either copied
  211. or deleted.
  212. The doubly indirect block pointer is invalid (8). Indirect block pointers
  213. are physical block pointers, so the message about a bad pointer may display
  214. the wrong value. The block should be deleted and the size of the file 
  215. reduced to 8192 bytes.
  216. .IP "File 14 - \fIcopyIndBlock\fR"
  217. File 14 shares the doubly indirect block with file 10. New data blocks should
  218. be allocated for the doubly indirect block (48), the indirect block it contains
  219. (52),
  220. and the direct block it contains (56).
  221. .IP "File 15 - \fIcopyBogusIndBlock\fR"
  222. File 15 shares its doubly indirect block with file 10. Block 56 is not
  223. a valid indirect block and should be 
  224. deleted from file 15.
  225. This leaves file 15 with 0 blocks so it should be truncated to length
  226. 0 and the block count corrected from 1 to 0.
  227. .IP "File 16 - bad magic number"
  228. File 16 has a bad magic number and should be marked as free.
  229. .IP "File 17 - unreferenced directory"
  230. File 17 is an unreferenced directory that should be put in lost+found.
  231. The link counts in lost+found and file 17 should be fixed accordingly.
  232. .IP "File 18 - \fIoutput\fR"
  233. File 18 is the output file for saving the results of running fscheck. It
  234. initially has two data blocks allocated to it.
  235. .SH KEYWORDS
  236. filesystem fscheck fsmake
  237.